﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using CNShapes;

namespace CNNetworking
{
    /// <summary>
    /// The interface used by the client to send data to the server. This includes
    /// initial connection and sending updates to data that has been changed by the
    /// client. The server 'broadcasts' data sent by other clients back to the clients
    /// via the IServerToClient callback-interface.
    /// </summary>
    [ServiceContract(CallbackContract=typeof(IServerToClient))]
    interface IClientToServer
    {
        /// <summary>
        /// Called after we have made the physical connection to the server, and passed our
        /// name to the server. The server returns true if the connection was allowed, false
        /// if it was rejected.
        /// </summary>
        [OperationContract(IsOneWay = true)]
        void connect(Guid clientID, string strName);

        /// <summary>
        /// Called by the client shortly before disconnecting.
        /// </summary>
        [OperationContract(IsOneWay = true)]
        void disconnect(Guid clientID);

        [OperationContract(IsOneWay = true)]
        void sendServerConnectionList(IList<ConnectionSettings> serverConnectionSettings);

        [OperationContract(IsOneWay = true)]
        [NetDataContract]
        void shapeEdited(Guid clientID, Guid sessionID, Guid pageID, Shape shape);
    }
}
